#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int fun(int m, int n)
{
	int tmp = m ^ n;
	int count = 0;
	while (tmp != 0)
	{
		count++;
		tmp = tmp & (tmp - 1);
	}
	return count;
}
int main()
{
	int m = 0;
	int n = 0;
	scanf("%d %d", &m, &n);
	int ret = fun(m, n);
	printf("%d", ret);
	return 0;
}